package com.override;

/**
 * @Author 小闽
 * @Date 2024/8/11 8:19
 * @PackageName: com.override
 * @ClassName: Student
 * @Description: 学生类
 * @Version 1.0
 */
public class Student extends Person {
    private int id;
    private double score;
    /**
     * 构造器
     */
    public Student(String name, int age, int id, double score){
        super(name, age);
        this.id = id;
        this.score = score;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
    // 在这里通过继承父类，与父类中的方法一致，但是重写了父类中所没有的属性
    public String say(){
        return super.say() + "编号：" + id + "成绩：" + score;
    }
}
